package cn.edu.sgu.www.mhxysy.dto.gang;

import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.consts.RegExps;
import cn.edu.sgu.www.mhxysy.dto.DataTransferObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
public class GangDTO implements DataTransferObject {

    @NotBlank(message = CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "帮派ID", required = true)
    private String id;

    /**
     * 帮派名称
     */
    @NotBlank(message = "帮派名称" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "帮派名称", required = true)
    private String name;

    /**
     * 帮派等级
     */
    @Range(min = 1, max = 5, message = "帮派等级" + CustomMessages.ILLEGAL)
    @NotNull(message = "帮派等级" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "帮派等级", required = true)
    private Integer grade;

    /**
     * 帮派宗旨
     */
    @NotBlank(message = "帮派宗旨" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "帮派宗旨", required = true)
    private String purpose;

    /**
     * 帮派创始人
     */
    @NotBlank(message = "帮派创始人" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "帮派创始人", required = true)
    private String builder;

    /**
     * 创始人ID
     */
    @Pattern(regexp = RegExps.ROLE_ID, message = "创始人ID" + CustomMessages.ILLEGAL)
    @NotBlank(message = "创始人ID" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "创始人ID", required = true)
    private String builderId;

    /**
     * 服务器ID
     */
    @Positive(message = "服务器ID" + CustomMessages.ILLEGAL)
    @NotNull(message = "服务器" + CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "服务器ID", required = true)
    private Integer serverId;
}